﻿using System;

namespace ShippingManage
{
	public partial class Global
	{
		#region Singleton I
		/// <summary>
		/// Static variable for thread locking
		/// </summary>
		static object SyncRoot = new object();

		/// <summary>
		/// Actual static variable for I
		/// </summary>
		static Global mInstance = null;

		/// <summary>
		/// Gets the static instance of this class
		/// </summary>
		public static Global I
		{
			get
			{
				if (mInstance == null)
				{
					//initialize new instance
					Global tmp = new Global();

					//assign to static variable. Lock root for thread-safe locking
					lock (SyncRoot)
					{
						mInstance = tmp;
					}
				}

				return mInstance;
			}
		}
		#endregion

		static Guid _CurrentUserId = Guid.Empty;
		public static Guid CurrentUserId
		{
			get { return _CurrentUserId; }
			set { _CurrentUserId = value; }
		}

		#region Now

		public static DateTime Now
		{
			get { return DateTime.Now; }
		}

		#endregion

		#region ConnectionStringName

		public string ConnectionStringName
		{
			get { return "DefaultConnection"; }
		}

		#endregion

	}
}
